<?php
/*
*产品属性类型删除
*/
namespace Admin\Func;

class Func902020110 {
    var  $db;
    var $rst;
    var $errmsg;
    var  $ProductCode;
    var  $ProductPropertyTypeID;

    public function __construct($ProductCode,$ProductPropertyTypeID) {
        $this->db  = new \Think\Model();
        $this->errmsg = '';
        $this->ProductCode = addslashes($ProductCode);
        $this->ProductPropertyTypeID = addslashes($ProductPropertyTypeID);

    }
    /*
    *获取错误信息
    */
    public function getErrMsg() {
        return $this->errmsg;
    }
    /*
    *验证
    */
    private function validate(){
        return true;
    }
    /*
    *执行
    */
    public function execute(){
        $vflag = true;
        $OperID = I('OperID');
        if($this->validate()){

            $sql = <<<EOD
DELETE FROM t_lz_ps_product_propertytype
WHERE 1=1  AND ProductCode = '$this->ProductCode' 
 AND ProductPropertyTypeID = '$this->ProductPropertyTypeID' 

EOD;

            //$this->rst = $this->db->query($sql);
            $this->rst = $this->db->execute($sql);
            if ($this->rst === false){
                $this->errmsg = $this->db->getDbError();
                $vflag = false;
            }else{
                $vflag = true;  
            }
        }else{
            $vflag = false;
        }
    return  $vflag;
    }
    public function getRst(){
        return $this->rst;
    }
}
